﻿using System;
using Microsoft.Xna.Framework;

namespace Ferpect.ComponentModel
{
    public class GamerServicesComponent : Microsoft.Xna.Framework.GamerServices.GamerServicesComponent
    {
        private bool initialized;

        public GamerServicesComponent(Game game)
            : base(game)
        {
        }

        public override void Initialize()
        {
            try
            {
                if (!this.initialized)
                {
                    // Guard against re-entrancy during Initialize.
                    this.initialized = true;
                    base.Initialize();
                }
            }
            catch (Exception)
            {
                this.initialized = false;
                throw;
            }
        }
    }
}
